package com.study.pagehelper.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.study.pagehelper.dao.SubjectDAO;
import com.study.pagehelper.pojo.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName SubjectService
 * @Author swj
 * @Date 2020/10/9 14:40
 */
@Service
public class SubjectService {

    @Autowired
    SubjectDAO subjectDAO;

    public PageInfo<Subject> getAllLimit(Integer start,Integer limit) {

        PageHelper.startPage(start,limit);
        List<Subject> subjectList = subjectDAO.selectAll();
        PageInfo<Subject> subejctPageInfo = new PageInfo<>(subjectList);

        return subejctPageInfo;
    }



}
